<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>第二种头部</title>
    <link rel="stylesheet" type="text/css" href="../../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #f7f7f7;
            line-height: 1;
        }
        /*修改icon*/

        .left_icon {
            font-size: 1rem!important;
            color: #000!important;
        }

        .right_img {
            width: 1rem;
        }
        /*修改头部标题*/

        .header_title {
            font-size: 0.9rem;
            font-weight: bold;
        }
        /*固定头部*/

        .header {
            background-color: #fff;
            border: none!important;
            z-index: 8!important;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav header" id='header' style="padding-top:25px;">
        <a class="aui-pull-left aui-btn" onclick="close_win()">
            <span class="aui-iconfont aui-icon-left left_icon"></span>
        </a>
        <div class="aui-title header_title">群名</div>
        <a class="aui-pull-right aui-btn" onclick="open_new_win('one','详细资料','群资料')">
            <img src="../../../image/four/group_detail.png" alt="" class="right_img">
        </a>
    </header>

</body>
<script type="text/javascript" src="../../../script/api.js"></script>
<script type="text/javascript" src="../../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../../script/vue.min.js"></script>
<script type="text/javascript" src="../../../script/utils.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script type="text/javascript" src="../../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../../script/aui-pull-refresh.js"></script>
<script type="text/javascript">
    apiready = function() {
        //获取header的高度
        var oHeader = $api.byId("header");
        var headerH = $api.offset(oHeader).h;
        $('.header_title').text(api.pageParam.group_chat_name);
        api.execScript({
            name: 'four_frame/four_index.html',
            frameName: 'chat_list',
            script: 'window.location.reload();'
        });

        //打开群聊的页面
        api.openFrame({
            name: 'group_chat',
            url: '../group_chat.html',
            rect: {
                x: 0,
                y: headerH,
                w: 'auto',
                h: 'auto'
            },
            pageParam: {
                group_chat_id: api.pageParam.group_chat_id,
                group_chat_name: api.pageParam.group_chat_name
            },
            bounces: false,
            bgColor: 'rgba(0,0,0,0)',
            vScrollBarEnabled: true,
            hScrollBarEnabled: true
        });


    };

    // 关闭当前窗口
    function close_win() {
        api.closeWin({});
        if(api.pageParam.num==1){
          api.execScript({
              name: 'four_frame/four_index.html',
              frameName: 'chat_list',
              script: 'shuaxin();'
          });
        }
    }



    // 打开新的窗口
    function open_new_win(index, title, type) {
        api.openWin({
            name: 'four_' + index + '_header' + api.pageParam.num,
            url: 'four_' + index + '_header.html',
            pageParam: {
                title: title,
                type: type,
                group_chat_id: api.pageParam.group_chat_id,
                num: api.pageParam.num
            }
        });
    }



    // 修改群名字
    function change_group_name(name){
      $('.header_title').text(name);
    }
</script>

</html>
